/**
 * Copyright (c) 2017-present, Liu Jinyong
 * All rights reserved.
 *
 * https://github.com/huanxsd/MeiTuan  
 * @flow
 */

import React from 'react'
import ReactNative, { View, StyleSheet, Dimensions, Text, Image } from 'react-native'
import color from './color'
import LinearGradient from 'react-native-linear-gradient'

export function Heading1({ style, ...props }: Object) {
    return <Text style={[styles.h1, style]} {...props} />
}

export function Heading2({ style, ...props }: Object) {
    return <Text style={[styles.h2, style]} {...props} />
}
export function Heading3({ style, ...props }: Object) {
    return <Text style={[styles.h3, style]} {...props} />
}

export function Paragraph({ style, ...props }: Object) {
    return <Text style={[styles.p, style]} {...props} />
}

export function Tip({ style, ...props }: Object) {
    return <Text style={[styles.tip, style]} {...props} />
}
//商品标题类的Text
export function Title({ style, ...props }: Object) {
    return <Text style={[styles.title, style]} {...props} />
}
//商品价格类的Text
export function ImagePrice({ style, ...props }: Object) {
    return (
        <View flexDirection={'row'} marginTop={15} style={{ justifyContent: 'center', alignItems: 'center' }}>
            <Image style={styles.memberPrice} resizeMode='contain' source={require('../img/home/member_price.png')} />
            <Text style={[styles.price, style]} {...props} />
        </View>
    )
    // <Text style={[styles.price, style]} {...props} />
}
//商品价格类的Text
export function Price({ style, ...props }: Object) {
    return <Text style={[styles.price, style]} {...props} />
}
//商品描述类的Text
export function Description({ style, ...props }: Object) {
    return <Text style={[styles.description, style]} {...props} />
}

//几人已买
export function SaleNum({ style, ...props }: Object) {
    return <View style={styles.SaleNum}>
        <Text style={[styles.saleNum, style]} {...props} />
    </View>
}

//赚取多少
export function Earn({ style, ...props }: Object) {
    return <View style={styles.earn}>
        <Text style={[styles.saleNum, style]} {...props} />
    </View>
}

const styles = StyleSheet.create({
    h1: {
        fontSize: 30,
        color: color.primary,
    },
    h2: {
        fontSize: 15,
        fontWeight: 'bold',
        color: '#222222',
    },
    h3: {
        fontSize: 14,
        color: '#222222',
    },
    p: {
        fontSize: 12,
        color: '#FF7F00',
    },
    tip: {
        fontSize: 13,
        color: '#999999'
    },
    saleNum: {
        color: '#FF6060',
        fontSize: 10,
    },
    description: {
        fontSize: 10,
        color: '#999999'
    },
    title: {
        fontSize: 13,
        color: '#222222',
    },
    price: {
        fontSize: 13,
        color: '#FF7F00',
        fontWeight: "bold",
    },
    memberPrice: {
        width: 36,
        height: 14.4,
        marginRight: 5,
    },
    SaleNum: {
        borderColor: '#FF6060',
        alignItems: 'center',
        justifyContent: 'center',
        borderRadius: 2,
        borderWidth: 1
    },
    earn: {
        borderColor: '#FF6060',
        alignItems: 'center',
        justifyContent: 'center',
        borderRadius: 2,
        borderWidth: 1,
        marginLeft: 2,
    }

})
